import 'package:event_bus/event_bus.dart';

import '../entity/bank_list_entity.dart';
import '../entity/order_detail_entity.dart';
import '../entity/order_list_entity.dart';
import '../entity/product_detail_entity.dart';
import '../entity/refund_reason_entity.dart';
import '../entity/shopping_car_list_entity.dart';

///单例类
class SingletonManager {
  // 工厂方法构造函数,通过SingletonManager()获取对象
  factory SingletonManager() => _getInstance();

  // instance的getter方法 - 通过SingletonManager.instance获取对象
  static SingletonManager get instance => _getInstance();

  // 静态变量_instance，存储唯一对象
  static SingletonManager? _instance;

  // 获取唯一对象
  static SingletonManager _getInstance() {
    _instance ??= SingletonManager._internal();
    return _instance!;
  }

  //初始化...
  SingletonManager._internal() {
    //初始化其他操作...
  }

  //大图浏览得图片列表
  List galleryItems = [];

  //确认订单的当前sku,直接下单
  ProductDetailDataSku currentSKu = ProductDetailDataSku();

  //确认订单的当前选中商品列表,购物车下单
  List<ShoppingCarListData> currentCarConfirm = [];

  //取消订单的原因列表
  List orderCancelReason = [];

  //快递公司名称列表
  List expressNameList = [];

  //退款原因列表
  List<RefundReasonData> refundReason=[];

  //退货原因列表
  List<RefundReasonData> returnReason=[];

  //补发原因列表
  List<RefundReasonData> buReason=[];

  //当前要评论的订单列表item
  OrderListData currentOrderListItem = OrderListData();

  //当前要评论的订单详情
  OrderDetailEntity currentOrderDetail = OrderDetailEntity();

  //消息订阅与发布的唯一对象
  EventBus eventBus = EventBus();

  //当前要编辑的银行账户
  BankListDataData currentBankData = BankListDataData();
}
